Runtime agnostic representation of user code for execution with selected execution runtime

ABSTRACT

An execution environment in a computer system allows user code to be executed using multiple execution runtimes. The execution environment translates the user code into a runtime agnostic representation, selects an execution runtime for executing the runtime agnostic representation, and invokes a scheduler for the selected execution runtime. The scheduler dispatches tasks from the runtime agnostic representation for execution by the computer system using concurrency mechanisms in the selected execution runtime.

BACKGROUND

Computer systems often have the ability to execute different parts ofthe same program concurrently (i.e., in parallel). A programmergenerally expresses the concurrency within the program to enableconcurrent execution of the specified parts. The expression ofconcurrency in programs, however, is usually tightly coupled to theexecution environment used to execute the program. The executionenvironment for a program may include, for example, the type of computersystem, the programming language of the program, and runtime library orlibraries in a computer system. As a result of this coupling, a programwritten for one execution environment may not be executable with anotherexecution environment.

Even if a program may be executable in different execution environments,the program may not be able to take full advantage of the computeresources available in some execution environments. For example, aprogram written for a single machine may not execute on a cluster orcloud of machines. Even if the program is modified to execute on acluster or cloud, the program may not be able to use the resources thatare made available dynamically, such as by adding a new machine to thecluster or cloud.

SUMMARY

This summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

An execution environment in a computer system allows user code to beexecuted using multiple execution runtimes. The execution environmenttranslates the user code into a runtime agnostic representation, selectsan execution runtime for executing the runtime agnostic representation,and invokes a scheduler for the selected execution runtime. Thescheduler dispatches tasks from the runtime agnostic representation forexecution by the computer system using concurrency mechanisms in theselected execution runtime.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are included to provide a furtherunderstanding of embodiments and are incorporated in and constitute apart of this specification. The drawings illustrate embodiments andtogether with the description serve to explain principles ofembodiments. Other embodiments and many of the intended advantages ofembodiments will be readily appreciated as they become better understoodby reference to the following detailed description. The elements of thedrawings are not necessarily to scale relative to each other. Likereference numerals designate corresponding similar parts.

FIG. 1 is a block diagram illustrating an embodiment of an executionenvironment in a computer system.

FIG. 2 is a block diagram illustrating an embodiment of generating aruntime agnostic intermediate representation of user code.

FIG. 3 is a block diagram illustrating an embodiment of executing usercode using a runtime agnostic intermediate representation.

FIGS. 4A-4C are block diagrams illustrating embodiment of computersystems configured to implement the execution environment shown in FIG.1.

DETAILED DESCRIPTION

In the following Detailed Description, reference is made to theaccompanying drawings, which form a part hereof, and in which is shownby way of illustration specific embodiments in which the invention maybe practiced. In this regard, directional terminology, such as “top,”“bottom,” “front,” “back,” “leading,” “trailing,” etc., is used withreference to the orientation of the Figure(s) being described. Becausecomponents of embodiments can be positioned in a number of differentorientations, the directional terminology is used for purposes ofillustration and is in no way limiting. It is to be understood thatother embodiments may be utilized and structural or logical changes maybe made without departing from the scope of the present invention. Thefollowing detailed description, therefore, is not to be taken in alimiting sense, and the scope of the present invention is defined by theappended claims.

It is to be understood that the features of the various exemplaryembodiments described herein may be combined with each other, unlessspecifically noted otherwise.

FIG. 1 is a block diagram illustrating an embodiment of an executionenvironment 10 in a computer system such as a computer system 100 shownin FIG. 4A (e.g., a single machine), a computer system 150 shown in FIG.4B (e.g., a cluster of machines), or a computer system 160 shown in FIG.4C (e.g., a cloud of machines). Execution environment 10 represents aruntime mode of operation in the computer system where the computersystem is executing instructions on one or more processing cores of thecomputer system such as processing cores 103 shown in FIG. 4A anddescribed in additional detail below. Execution environment 10 includesinvoked user code 12 with a set of two or more tasks 14,runtime-agnostic library 16, a runtime-agnostic representation (RAR) 18of user code 12, an invoked scheduler 20, and execution runtimes24(1)-24(M), where M is an integer that is greater than or equal to twoand denotes the Mth execution runtime 24(M).

Execution environment 10 provides a distributed tasks programming modelthat allows user code 12 to be executed using different executionruntimes 24(1)-24(M). In particular, execution environment 10dynamically binds user code 12 to a selected execution runtime 24 toallow the execution of user code 12 to be scaled within the computersystem of execution environment 10. Execution environment 10 allowstasks 14 defined by user code 12 to be executed concurrently usingruntime-agnostic library 16, RAR 18, scheduler 20, and the selectedexecution runtime 24.

Each execution runtime 24(1)-24(M) typically corresponds to aprogramming language and/or programming model suitable for theunderlying computer system. For example, one execution runtime 24 (e.g.,the Microsoft Concurrency Runtime (ConcRT)) may be designed to enhanceparallel execution of user code 12 on a single machine with multipleprocessing cores (e.g., computer system 100 shown in FIG. 4A), anotherexecution runtime 24 (e.g., the Message Passing Interface (MPI) runtime)may be designed to enhance parallel execution of user code 12 on acluster of machines (e.g., computer system 150 shown in FIG. 4B), and afurther execution runtime 24 may be designed to enhance parallelexecution of user code 12 on a cloud of machines (e.g., computer system160 shown in FIG. 4C).

User code 12 includes a sequence of instructions that form an intuitiveexpression of one or more parallel algorithms. User code 12 bases eachalgorithm on data flow by specifying tasks 14 and the interactions oftasks 14 within each algorithm. User code 12 expresses tasks 14 and theinteractions of tasks 14 without explicit reference to the programmingfeatures or constructs of any particular execution runtime 24(1)-24(M).Accordingly, user code 12 may be translated into RAR 18 and executedusing a scheduler 20 and an execution runtime 24(1)-24(M) selected byruntime-agnostic library 16. In one embodiment, user code 12 includes aninstruction that invokes an application program interface (API) inruntime-agnostic library 16 to initiate the execution of tasks 14. Inother embodiments, user code 12 uses other programming languageconstructs and/or corresponding tools provided by runtime-agnosticlibrary 16 to initiate the execution of tasks 14 using a dynamicallyselected execution runtime 24(1)-24(M).

Each task 14 includes a sequence of instructions that performs a unit ofwork when executed by the computer system. Each task 14 isself-contained (i.e., free of side effects) and operates on a definedset of input data to produce a defined set of output data. The set ofoutput data produced by one task 14 may be used as all or a portion ofthe set of input data for another task 14. Accordingly, tasks 14 may useinput data that was produced by one or more other tasks 14 and mayproduce output data that will be used as input data by one or more tasks14. Tasks 14, however, are defined such that they do not share data(i.e., operate on the same set of data concurrently). Because the inputand output data of tasks 14 are well-defined, the interactions of tasks14 may be determined by runtime-agnostic library 16. Tasks 14 are codedsuch that each task 14 may be activated and dispatched by scheduler 20for concurrent execution by processing cores of the computer system whenthe set of input data for the task 14 becomes available.

In one embodiment, user code 12 is written in a native, i.e., unmanaged,programming language such as C++. In this embodiment, each task 14 maybe coded as an abstraction for a C++ Lambda expression that includes aset of sequential or other suitable instructions. In other embodiments,user code 12 may be written in other suitable native programminglanguages that may be translated into an RAR 18 and executed by aselected execution runtime 24(1)-24(M). Similarly, each task 14 may becoded using other suitable programming language constructs.

User code 12 may be configured to operate in one or more computersystems based on any suitable computer system execution model, such as astack model or an interpreter model, and may represent any suitable typeof code, such as an application, a library function, or an operatingsystem service. User code 12 has a program state and machine stateassociated with a set of allocated resources of the computer system thatinclude a defined memory address space. User code 12 executesautonomously or substantially autonomously from any co-existingprocesses in execution environment 10. Accordingly, user code 12 doesnot adversely alter the program state of co-existing processes or themachine state of any resources allocated to co-existing processes.Similarly, co-existing processes do not adversely alter the programstate of user code 12 or the machine state of any resources allocated touser code 12.

In response to user code 12 initiating the execution of tasks 14,runtime-agnostic library 16 translates user code 12 into RAR 18, selectsan execution runtime 24 for executing RAR 18, and invokes a scheduler 20for the selected execution runtime 24. As noted above, user code 12 mayinvoke an API in runtime-agnostic library 16 or use another suitableprogramming construct to initiate the execution of tasks 14.

Runtime-agnostic library 16 identifies tasks 14 and the interactions oftasks 14 in user code 12 based on the inherent parallelism in userprogram 12. Runtime-agnostic library 16 translates user code 12 into RAR18 such that RAR 18 embodies the inherent parallelism of user code 12and may be executed by any of execution runtimes 24(1)-24(M). RAR 18includes abstractions of tasks 14 that may be ported to a scheduler 20of any of execution runtimes 24(1)-24(M). In one embodiment,runtime-agnostic library 16 generates RAR 18 by forming a directedacyclic graph (DAG) that specifies continuations between tasks 14 inuser code 12 to represent the flow of data in user code 12. With a DAG,runtime-agnostic library 16 forms nodes that represent tasks 14 andexpresses the relationships between the nodes according to the flow ofdata (i.e., interactions) between tasks. In other embodiments,runtime-agnostic library 16 generates RAR 18 using other suitable datastructures to represent the inherent parallelism in user program 12.

Along with creating RAR 18, runtime-agnostic library 16 selects anexecution runtime 24(1)-24(M) for executing user code 12 based onheuristics corresponding to the underlying computer system and RAR 18.In particular, runtime-agnostic library 16 attempts to achieve optimalscaling for user code 12 by selecting that execution runtime 24(1)-24(M)that may execute tasks 14 of user code 12 most efficiently.Runtime-agnostic library 16 considers the characteristics of user code12 (e.g., data intensive versus compute intensive) and determines anappropriate level of computing resources for executing user code 12(e.g., a single machine, a cluster of machines, or a cloud of machines)given the underlying computer system. After making the determination,runtime-agnostic library 16 creates an instance of a scheduler 20 forthe selected execution runtime 24.

Scheduler 20 causes tasks 14 of user code 12 to be executed using theselected execution runtime 24 in execution environment 10. Scheduler 20queues tasks 14 from RAR 18 and dispatches tasks 14 from user code 12for execution by calling APIs or using other suitable programmingconstructs in the selected execution runtime 24. Scheduler 20 dispatchestasks 14 according to any suitable scheduling algorithm. Scheduler 20manages the execution of tasks 14 by dispatching tasks 14 for executionwhen the set of input data for tasks 14 and processing resources of thecomputer system become available. As described above, the set of inputdata for a task 14 may become available upon completion of one or moreother tasks 14.

By dynamically binding of user code 12 to a selected execution runtime24, execution environment 10 delineates the programming model for usercode 12 from the set of execution runtimes 24(1)-24(M). By doing so, thesame user code 12 may be used to target different execution runtimes24(1)-24(M) without incurring the overhead of including runtime-specificcode for each execution runtime 24(1)-24(M). As a result, executionenvironment 10 supports a programming model for user code 12 thatprovides automatic scaling from a single machine to multiple machines(e.g., a cluster or a cloud).

Execution environment 10 may also provide a rich programming model thatsupports features of execution runtimes 24(1)-24(M). For example, oneexecution runtime 24, such as MPI, may specify that data passed betweennodes in cluster of machines is to be serialized whereas anotherexecution runtime 24, such as ConcRT, may allow data to be accessedusing pointers on shared memory machines. With a rich programming model,user code 12 includes appropriate serialization routines for userdefined types for runtimes 24 such as MPI. Execution environment 10(i.e., runtime-agnostic library 16 and scheduler 20), however, ensuresthat the serialization routines are not invoked when user code 12 isexecuted on a shared memory machine.

Execution environment 10 may further provide a rich programming modelthat supports deadlock prevention and fault tolerance. By generating RAR18, execution environment 10 precludes cycles and therefore eliminatesdeadlocks and avoids the use of expensive dynamic deadlock detectionstrategies. In addition, because tasks 14 are coded to be free of sideeffects, tasks 14 may be restarted on other computing nodes if a givencomputing node fails during the execution of a task 14.

In one embodiment, execution environment 10 is implemented using adeclarative programming model on a native language such as C++. In thisembodiment, user code 12 is written with a query syntax in the nativelanguage that inherently expresses tasks 14 in terms of data flow. Withthe query syntax, tasks 14 of user code 12 are side effect free bydefinition and have well-defined interactions. As a result, theexecution of user code 12 may be automatically scaled from a singlemachine to a distributed environment such as a cluster or a cloud.

FIG. 2 is a block diagram illustrating an embodiment 12A of user code 12with a query syntax. In the example of FIG. 2, user code 12A expresses amap-reduce operation as a native language query. By doing so, user code12A allows runtime-agnostic library 16 to generate an embodiment of aRAR 18 that forms a runtime-agnostic DAG 18A as indicated by an arrow32. Runtime-agnostic library 16 identifies tasks 14(1)-14(4) from thequery in user code 12A (i.e., reader, SelectMany(mapper), GroupBy, andSelectMany(reducer), respectively) and translates a representation oftasks 14(1)-14(4) into DAG 18A (shown as blocks in a flow diagram in theembodiment of FIG. 2). Runtime-agnostic library 16 also identifies theinteractions of tasks 14(1)-14(4) and translates a representation of theinteractions into DAG 18A. The interactions specify continuationsbetween tasks 14 that include the set of data that is output by one task14 and input to another task 14. In FIG. 2, an arrow 34(1) representsthe interaction between task 14(1) (i.e., reader) and task 14(2) (i.e.,SelectMany(mapper)). In other words, arrow 34(1) represents the set ofdata that is output by task 14(1) and input to task 14(2). Similarly, anarrow 34(2) represents the interaction between task 14(2) and task14(3), and an arrow 34(3) represents the interaction between task 14(3)and task 14(4).

In the example of FIG. 2, tasks 14 receive a set of input data from oneother task 14 and provide a set of output data to one other task 14. Inother embodiments, each task 14 may receive a set of input data from anysuitable number of other tasks 14 and/or may provide a set of outputdata to any suitable number of other tasks 14.

In the embodiment of FIG. 2, the query syntax uses a method-basedinvocation strategy such that the query syntax is not directlyintegrated into the native programming language. For example, with anative programming language such as C++, the query syntax may beimplemented using lambda expressions. The query syntax may be composedwith other code in the native language in user code 12 and may allow forlazy execution of user code 12. As a result, a declarative programmingmodel with a query syntax may be implemented on a native language suchas C++ and use the existing native language compiler while providingincreased execution performance in distributed environments.

In one embodiment, execution environment 10 provides dynamic data andcompute resources elasticity for user code 12 to improve executionefficiency. In particular, execution environment 10 allows the executionof user code 12 to be elastic to the size of data operated on by tasks14, the compute resources available at runtime, and anycontext-sensitive heuristics provided by user code 12. Executionenvironment 10 provides the elasticity through the use of RAR 18 andscheduler 20. Elasticity refers to the ability to dynamically adjust thelevel of concurrency for each task 14 of user code 12 based on theamount of data and compute resources available at the time of executionof that task 14.

As described above, scheduler 20 dispatches tasks 14 for execution whenthe set of input data for tasks 14 and processing resources of thecomputer system become available. For each task 14 in RAR 18, scheduler20 determines the level of concurrency by considering the size of theset of input data for the task 14, the amount of compute resourcesavailable at the time of invocation of the task 14, and anycontext-sensitive heuristics provided by user code 12. Scheduler 20invokes and distributes a number of instances of a task 14 that dependson the determined level of concurrency to the available computeresources. By doing so, scheduler 20 automatically scales the executionof user code 12 to an appropriate level given the size of the set ofinput data, the available compute resources, and the user-specifiedheuristics.

Scheduler 20 considers the size of the set of input data for each task14 in determining an appropriate level of concurrency. In particular,scheduler 20 may consider the amount of overhead of moving the inputdata within the computer system (e.g., the time spent moving the databetween machines in a cluster). For example, based on the overhead,scheduler 20 may select a lower level of concurrency for tasks 14 withsmaller amounts of input data and a higher level of concurrency fortasks 14 with larger amounts of input data.

Because scheduler 20 determines the appropriate level of concurrency atthe time of invocation for each task 14, scheduler 20 accounts forchanges in the availability of compute resources in the underlyingcomputer system. For example, scheduler 20 may detect that computeresources have been added to the computer system (e.g., due to one ormore machines being added to the computer system) or removed from thecomputer system (e.g., due to failures or unavailability of one or morenodes of the computer system).

Scheduler 20 may provide information that expresses the size of theinput data of a task 14 and the amount of available compute resourcesfor a task 14 to one or more functions in user code 12. The functions,in turn, may provide scheduler 20 with a suggested or optimal level ofconcurrency that the programmer recommends for executing a task 14.Scheduler 20 considers this information along with the size of the inputdata and the amount of available compute resources to determine theappropriate level of concurrency for a task 14.

FIG. 3 is a block diagram illustrating an embodiment of executing usercode 12 using DAG 18A (shown in FIG. 2). In the example of FIG. 3,scheduler 20 determines the appropriate level of concurrency for each oftasks 14(1)-14(4) in DAG 18A and creates an appropriate number ofinstances of each task 14(1)-14(4) based on the levels of concurrency.For example, scheduler 20 determines that a single instance isappropriate for task 14(1) based on the above factors when task 14(1) isinvoked. Similarly, scheduler 20 determines that a single instance isappropriate for task 14(3) based on the above factors when task 14(3) isinvoked.

For task 14(2), scheduler 20 determines that N instances are appropriatewhere N is an integer that is greater than or equal to two. Accordingly,scheduler 20 causes the set of input data for task 14(2) to bepartitioned into N subsets and provided to up to N compute resources(e.g., nodes machines in a cluster or cloud) for execution. Scheduler 20also causes the set of output data generated by task 14(2) to be mergedinto a form that can be provided to task 14(3).

For task 14(4), scheduler 20 determines that P instances are appropriatewhere P is an integer that is greater than or equal to two and may beequal or not equal to N. Accordingly, scheduler 20 causes the set ofinput data for task 14(4) to be partitioned into P subsets and providedto up to P compute resources (e.g., nodes machines in a cluster orcloud) for execution. Scheduler 20 also causes the set of output datagenerated by task 14(4) to be merged into a form that can be provided asan output of the query.

The dynamic data and compute elasticity provide a technique by whichoptimal scaling of user code 12 may occur. The flexibility inestablishing the level of concurrency for each task 14 in RAR 18 or DAG18A allows user code 12 to be elastic to available compute resources andload balance effectively. Accordingly, user code 12 may be efficientlyexecuted on a variety of computer systems.

FIG. 4A is a block diagram illustrating an embodiment of computer system100 which is configured to implement execution environment 10 asdescribed above.

Computer system 100 includes one or more processor packages 102 thateach include one or more processing cores 103, memory system 104, zeroor more input/output devices 106, zero or more display devices 108, zeroor more peripheral devices 110, and zero or more network devices 112.Processor packages 102, memory system 104, input/output devices 106,display devices 108, peripheral devices 110, and network devices 112communicate using a set of interconnections 114 that includes anysuitable type, number, and configuration of controllers, buses,interfaces, and/or other wired or wireless connections.

Computer system 100 represents any suitable processing device configuredfor a general purpose or a specific purpose. Examples of computer system100 include a server, a personal computer, a laptop computer, a tabletcomputer, a personal digital assistant (PDA), a mobile telephone orsmartphone, and an audio/video device. The components of computer system100 (i.e., processor packages 102, memory system 104, input/outputdevices 106, display devices 108, peripheral devices 110, networkdevices 112, and interconnections 114) may be contained in a commonhousing (not shown) or in any suitable number of separate housings (notshown).

Processor packages 102 each include one or more processing cores 103that form execution hardware configured to execute instructions (i.e.,software). Each processing core 103 is configured to executeinstructions independently or substantially independently from the otherprocessing cores 103 and includes a machine state. Each processorpackage 102 may include processing cores 103 with the same or differentarchitectures and/or instruction sets. For example, the processing cores103 may include any combination of in-order execution cores, superscalarexecution cores, and GPGPU execution cores. Each processing core 103 inprocessor packages 102 is configured to access and execute instructionsstored in memory system 104. The instructions may include a basic inputoutput system (BIOS) or firmware (not shown), user code 12,runtime-agnostic library 16, scheduler 20, an operating system (OS) 122,and a set 124 of one or more execution runtimes 24. Each processing core103 may execute the instructions in conjunction with or in response toinformation received from input/output devices 106, display devices 108,peripheral devices 110, and/or network devices 112.

Memory system 104 includes any suitable type, number, and configurationof volatile or non-volatile storage devices configured to storeinstructions and data. The storage devices of memory system 104represent computer readable storage media that store computer-executableinstructions (i.e., software) including user code 12, runtime-agnosticlibrary 16, scheduler 20, OS 122, and a set 124 of one or more executionruntimes 24. Memory system 104 stores instructions and data receivedfrom processor packages 102, input/output devices 106, display devices108, peripheral devices 110, and network devices 112. Memory system 104provides stored instructions and data to processor packages 102,input/output devices 106, display devices 108, peripheral devices 110,and network devices 112. The instructions are executable by computersystem 100 to perform the functions and methods of user code 12,runtime-agnostic library 16, scheduler 20, OS 122, and executionruntimes 24 described herein. Examples of storage devices in memorysystem 104 include hard disk drives, random access memory (RAM), readonly memory (ROM), flash memory drives and cards, and magnetic andoptical disks such as CDs and DVDs.

Computer system 100 boots and executes OS 122. OS 122 includesinstructions executable by processor packages 102 to manage thecomponents of computer system 100 and provide a set of functions thatallow runtime-agnostic library 16, scheduler 20, OS 122, and executionruntimes 24 to access and use the components. In one embodiment, OS 122is the Windows operating system. In other embodiments, OS 122 is anotheroperating system suitable for use with computer system 100.Runtime-agnostic library 16 includes instructions that are executable inconjunction with OS 122 to generate execution environment 10 shown inFIG. 1 and provide runtime functions to user code 12 and scheduler 20.The runtime functions may be included as an integrated part of OS 122 orother programming entities and/or constructs in other embodiments.

Input/output devices 106 include any suitable type, number, andconfiguration of input/output devices configured to input instructionsor data from a user to computer system 100 and output instructions ordata from computer system 100 to the user. Examples of input/outputdevices 106 include a keyboard, a mouse, a touchpad, a touchscreen,buttons, dials, knobs, and switches.

Display devices 108 include any suitable type, number, and configurationof display devices configured to output textual and/or graphicalinformation to a user of computer system 100. Examples of displaydevices 108 include a monitor, a display screen, and a projector.

Peripheral devices 110 include any suitable type, number, andconfiguration of peripheral devices configured to operate with one ormore other components in computer system 100 to perform general orspecific processing functions.

Network devices 112 include any suitable type, number, and configurationof network devices configured to allow computer system 100 tocommunicate across one or more networks (not shown). Network devices 112may operate according to any suitable networking protocol and/orconfiguration to allow information to be transmitted by computer system100 to a network or received by computer system 100 from a network.

FIG. 4B is a block diagram illustrating an embodiment of computer system150 which is configured to implement execution environment 10 asdescribed above. Computer system 150 forms a distributed computingenvironment that includes a set of two or more computer systems100(1)-100(Q) where Q is an integer that is greater than or equal totwo. Computer systems 100(1)-100(Q) communicate using a set ofinterconnections 152 that includes any suitable type, number, andconfiguration of controllers, buses, interfaces, and/or other wired orwireless connections.

Computer system 150 is configured as a cluster of machines (i.e., acluster of computer systems 100(1)-100(Q)). Each computer system100(1)-100(Q) may include the same configuration or differentconfiguration as other computer systems 100(1)-100(Q). In oneembodiment, each computer system 100(1)-100(Q)) in system 150 includes aruntime 24, such as MPI, that is configured for a cluster in addition toany other runtimes 24 that computer systems 100(1)-100(Q)) may include.In other embodiments, each computer system 100(1)-100(Q)) in system 150includes any suitable type, number, and/or combination of runtimes 24.

FIG. 4C is a block diagram illustrating an embodiment of computer system160 which is configured to implement execution environment 10 asdescribed above. Computer system 160 forms a distributed computingenvironment that includes a set of two or more computer systems100(1)-100(R) where R is an integer that is greater than or equal totwo. Computer systems 100(1)-100(R) communicate using a network 162 thatincludes any suitable type, number, and configuration of wired and/orwireless network devices.

Computer system 160 is configured as a cloud of machines (i.e., a cloudof computer systems 100(1)-100(R)). Each computer system 100(1)-100(R)may include the same configuration or different configuration as othercomputer systems 100(1)-100(R). In one embodiment, each computer system100(1)-100(R)) in system 160 includes a runtime 24 that is configuredfor a cloud in addition to any other runtimes 24 that computer systems100(1)-100(R)) may include. In other embodiments, each computer system100(1)-100(R)) in system 160 includes any suitable type, number, and/orcombination of runtimes 24.

Although specific embodiments have been illustrated and describedherein, it will be appreciated by those of ordinary skill in the artthat a variety of alternate and/or equivalent implementations may besubstituted for the specific embodiments shown and described withoutdeparting from the scope of the present invention. This application isintended to cover any adaptations or variations of the specificembodiments discussed herein. Therefore, it is intended that thisinvention be limited only by the claims and the equivalents thereof.

1. A computer readable storage medium storing computer-executable instructions that, when executed by a computer system, cause the computer system to perform a method comprising: selecting a first execution runtime in the computer system for execution of a runtime agnostic representation of user code, the first execution runtime selected based on at least one heuristic of the runtime agnostic representation; and invoking a scheduler to dispatch a set of tasks from the runtime agnostic representation for execution on the computer system using the first execution runtime.
 2. The computer readable storage medium of claim 1, the method further comprising: translating the user code into the runtime agnostic representation that includes the set of tasks.
 3. The computer readable storage medium of claim 1, wherein the user code inherently expresses the set of tasks and a set of interactions of the set of tasks.
 4. The computer readable storage medium of claim 1, wherein the user code specifies the set of tasks and a set of interactions of the set of tasks using a query syntax.
 5. The computer readable storage medium of claim 1, wherein the runtime agnostic representation is executable by the first execution runtime and a second execution runtime that differs from the first execution environment.
 6. The computer readable storage medium of claim 1, wherein the runtime agnostic representation expresses the set of tasks in terms of data flow.
 7. The computer readable storage medium of claim 1, wherein the runtime agnostic representation forms a directed acyclic graph (DAG).
 8. The computer readable storage medium of claim 1, wherein the first execution runtime corresponds to one of a single machine, a cluster of machines, or a cloud of machines.
 9. The computer readable storage medium of claim 1, wherein the computer system includes one of a single machine, a cluster of machines, or a cloud of machines.
 10. The computer readable storage medium of claim 1, wherein the scheduler is configured to dispatch a task in the set of tasks in response to set of input data corresponding to the task becoming available.
 11. A computer readable storage medium storing computer-executable instructions that, when executed by a computer system, cause the computer system to perform a method comprising: identifying an inherently expressed set of tasks and set of interactions of the set of tasks in user code; and translating the set of tasks and the set of interactions into a runtime agnostic representation of the user code.
 12. The computer readable storage medium of claim 11, wherein the runtime agnostic representation expresses the set of tasks in terms of data flow.
 13. The computer readable storage medium of claim 11, wherein the runtime agnostic representation forms a directed acyclic graph (DAG).
 14. The computer readable storage medium of claim 11, the method further comprising: selecting an execution runtime in the computer system for execution of the runtime agnostic representation at runtime.
 15. The computer readable storage medium of claim 11, wherein the execution runtime corresponds to one of a single machine, a cluster of machines, or a cloud of machines.
 16. The computer readable storage medium of claim 11, wherein the computer system includes a single machine, a cluster of machines, or a cloud of machines.
 17. A method performed by at least one computer system, the method comprising: translating user code into a runtime agnostic representation that forms a directed acyclic graph (DAG) that expresses a set of tasks in terms of data flow, wherein the user code inherently expresses the set of tasks and a set of interactions of the set of tasks; selecting a first execution runtime from a set of two or more execution runtimes in the computer system for execution of the runtime agnostic representation, the first execution runtime selected based on at least one heuristic of the runtime agnostic representation; and invoking a scheduler to dispatch the set of tasks from the runtime agnostic representation for execution on the computer system using the first execution runtime.
 18. The method of claim 17, wherein the runtime agnostic representation is executable by the first execution runtime and a second execution runtime in the set of two or more execution runtimes, and wherein the second execution runtime differs from the first execution environment.
 19. The method of claim 17, wherein the first execution runtime corresponds to one of a single machine, a cluster of machines, or a cloud of machines.
 20. The method of claim 17, wherein the computer system includes a single machine, a cluster of machines, or a cloud of machines. 